#!/bin/sh

cat /var/log/log.txt | grep HTTP | grep VIRUS | wc | awk '{print $1}' > /usr/local/apache2/htdocs/http.number
cat /var/log/log.txt | grep SMTP | grep virus | wc | awk '{print $1}' > /usr/local/apache2/htdocs/smtp.number
cat /var/log/log.txt | grep POP3 | grep virus | wc | awk '{print $1}' > /usr/local/apache2/htdocs/pop3.number
cat /var/log/log.txt | grep ftp  | grep VIRUS_INFECTED | wc | awk '{print $1}' > /usr/local/apache2/htdocs/ftp.number

cat /var/log/log.txt | grep HTTP | grep VIRUS  > /usr/local/apache2/htdocs/http.list
tail -n 50 /usr/local/apache2/htdocs/http.list > /usr/local/apache2/htdocs/http.txt
cat /var/log/log.txt | grep SMTP | grep virus  > /usr/local/apache2/htdocs/smtp.list
tail -n 50 /usr/local/apache2/htdocs/smtp.list > /usr/local/apache2/htdocs/smtp.txt
cat /var/log/log.txt | grep POP3 | grep virus  > /usr/local/apache2/htdocs/pop3.list
tail -n 50 /usr/local/apache2/htdocs/pop3.list > /usr/local/apache2/htdocs/pop3.txt
cat /var/log/log.txt | grep ftp  | grep VIRUS_INFECTED  > /usr/local/apache2/htdocs/ftp.list
tail -n 50 /usr/local/apache2/htdocs/ftp.list > /usr/local/apache2/htdocs/ftp.txt
